package com.example.test.chapter9.flipper;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ViewFlipper;

import com.example.test.R;
import com.example.test.chapter9.MainChapter9;

public class FlipperAActivity extends Activity {
	ViewFlipper flipper;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.flipper);
		flipper = (ViewFlipper) findViewById(R.id.detailFlips);
		Button btnNext = (Button) findViewById(R.id.flip_me);
		btnNext.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				flipper.showNext();
			}
		});
		Button btnPivious = (Button) findViewById(R.id.flip_me_pri);
		btnPivious.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				flipper.showPrevious();
			}
		});
		Button btn = (Button) findViewById(R.id.backpage);
		btn.setOnClickListener(new OnClickListener() {

			@Override
			public void onClick(View v) {
				Intent intent = new Intent(getApplicationContext(),
						MainChapter9.class);
				startActivity(intent);
				finish();
			}
		});
	}
}
